﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Storage;

namespace DDD.EFCore
{
    public interface ITransaction
    {
        //DbContext DbContext { get; }
        IDbContextTransaction? CurrentTransaction { get; }
        IDbContextTransaction BeginTransaction();
        Task CommitAsync(CancellationToken cancellationToken);
        Task RollbackAsync(CancellationToken cancellationToken);
    }
}
